package com.eaoa.vo.pub.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the pub_customer table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="pub_customer"
 */

public abstract class BasePubCustomer  implements Serializable {

	public static String REF = "PubCustomer";
	public static String PROP_NAMESHORT = "nameshort";
	public static String PROP_FAXPHONE = "faxphone";
	public static String PROP_BANKNAME = "bankname";
	public static String PROP_PUB_ADDRESS = "pubAddress";
	public static String PROP_CREATEDBYNAME = "createdbyname";
	public static String PROP_CUSTOMERTYPE = "customertype";
	public static String PROP_TELEPHONE = "telephone";
	public static String PROP_WEBSITE = "website";
	public static String PROP_STUFFNUM = "stuffnum";
	public static String PROP_CREATEBY = "createby";
	public static String PROP_MAINREGION = "mainregion";
	public static String PROP_NATURE = "nature";
	public static String PROP_CREATEDATE = "createdate";
	public static String PROP_NAME = "name";
	public static String PROP_CUSTOMERNO = "customerno";
	public static String PROP_ROUTENO = "routeno";
	public static String PROP_ISLOCK = "islock";
	public static String PROP_CUSTOMERCODE = "customercode";
	public static String PROP_BANKACCOUNT = "bankaccount";
	public static String PROP_CURRENCY = "currency";
	public static String PROP_ROUTEORDER = "routeorder";
	public static String PROP_INDUSTRY = "industry";


	// constructors
	public BasePubCustomer () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BasePubCustomer (java.lang.Long customerno) {
		this.setCustomerno(customerno);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Long customerno;

	// fields
	private java.lang.Long customertype;
	private java.lang.String customercode;
	private java.lang.String name;
	private java.lang.String nameshort;
	private java.lang.String telephone;
	private java.lang.String faxphone;
	private java.lang.String currency;
	private java.lang.String bankname;
	private java.lang.String bankaccount;
	private java.lang.String mainregion;
	private java.lang.Long createby;
	private java.lang.String createdbyname;
	private java.util.Date createdate;
	private java.lang.String islock;
	private java.lang.String website;
	private java.lang.String stuffnum;
	private java.lang.String industry;
	private java.lang.String nature;
	private java.lang.Long routeno;
	private java.lang.Long routeorder;

	// many to one
	private com.eaoa.vo.pub.PubAddress pubAddress;

	// collections
	private java.util.Set<com.eaoa.vo.pub.PubAccount> pubAccounts;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="increment"
     *  column="customerno"
     */
	public java.lang.Long getCustomerno () {
		return customerno;
	}

	/**
	 * Set the unique identifier of this class
	 * @param customerno the new ID
	 */
	public void setCustomerno (java.lang.Long customerno) {
		this.customerno = customerno;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: customertype
	 */
	public java.lang.Long getCustomertype () {
		return customertype;
	}

	/**
	 * Set the value related to the column: customertype
	 * @param customertype the customertype value
	 */
	public void setCustomertype (java.lang.Long customertype) {
		this.customertype = customertype;
	}



	/**
	 * Return the value associated with the column: customercode
	 */
	public java.lang.String getCustomercode () {
		return customercode;
	}

	/**
	 * Set the value related to the column: customercode
	 * @param customercode the customercode value
	 */
	public void setCustomercode (java.lang.String customercode) {
		this.customercode = customercode;
	}



	/**
	 * Return the value associated with the column: name
	 */
	public java.lang.String getName () {
		return name;
	}

	/**
	 * Set the value related to the column: name
	 * @param name the name value
	 */
	public void setName (java.lang.String name) {
		this.name = name;
	}



	/**
	 * Return the value associated with the column: nameshort
	 */
	public java.lang.String getNameshort () {
		return nameshort;
	}

	/**
	 * Set the value related to the column: nameshort
	 * @param nameshort the nameshort value
	 */
	public void setNameshort (java.lang.String nameshort) {
		this.nameshort = nameshort;
	}



	/**
	 * Return the value associated with the column: telephone
	 */
	public java.lang.String getTelephone () {
		return telephone;
	}

	/**
	 * Set the value related to the column: telephone
	 * @param telephone the telephone value
	 */
	public void setTelephone (java.lang.String telephone) {
		this.telephone = telephone;
	}



	/**
	 * Return the value associated with the column: faxphone
	 */
	public java.lang.String getFaxphone () {
		return faxphone;
	}

	/**
	 * Set the value related to the column: faxphone
	 * @param faxphone the faxphone value
	 */
	public void setFaxphone (java.lang.String faxphone) {
		this.faxphone = faxphone;
	}



	/**
	 * Return the value associated with the column: currency
	 */
	public java.lang.String getCurrency () {
		return currency;
	}

	/**
	 * Set the value related to the column: currency
	 * @param currency the currency value
	 */
	public void setCurrency (java.lang.String currency) {
		this.currency = currency;
	}



	/**
	 * Return the value associated with the column: bankname
	 */
	public java.lang.String getBankname () {
		return bankname;
	}

	/**
	 * Set the value related to the column: bankname
	 * @param bankname the bankname value
	 */
	public void setBankname (java.lang.String bankname) {
		this.bankname = bankname;
	}



	/**
	 * Return the value associated with the column: bankaccount
	 */
	public java.lang.String getBankaccount () {
		return bankaccount;
	}

	/**
	 * Set the value related to the column: bankaccount
	 * @param bankaccount the bankaccount value
	 */
	public void setBankaccount (java.lang.String bankaccount) {
		this.bankaccount = bankaccount;
	}



	/**
	 * Return the value associated with the column: mainregion
	 */
	public java.lang.String getMainregion () {
		return mainregion;
	}

	/**
	 * Set the value related to the column: mainregion
	 * @param mainregion the mainregion value
	 */
	public void setMainregion (java.lang.String mainregion) {
		this.mainregion = mainregion;
	}



	/**
	 * Return the value associated with the column: createby
	 */
	public java.lang.Long getCreateby () {
		return createby;
	}

	/**
	 * Set the value related to the column: createby
	 * @param createby the createby value
	 */
	public void setCreateby (java.lang.Long createby) {
		this.createby = createby;
	}



	/**
	 * Return the value associated with the column: createdbyname
	 */
	public java.lang.String getCreatedbyname () {
		return createdbyname;
	}

	/**
	 * Set the value related to the column: createdbyname
	 * @param createdbyname the createdbyname value
	 */
	public void setCreatedbyname (java.lang.String createdbyname) {
		this.createdbyname = createdbyname;
	}



	/**
	 * Return the value associated with the column: createdate
	 */
	public java.util.Date getCreatedate () {
		return createdate;
	}

	/**
	 * Set the value related to the column: createdate
	 * @param createdate the createdate value
	 */
	public void setCreatedate (java.util.Date createdate) {
		this.createdate = createdate;
	}



	/**
	 * Return the value associated with the column: islock
	 */
	public java.lang.String getIslock () {
		return islock;
	}

	/**
	 * Set the value related to the column: islock
	 * @param islock the islock value
	 */
	public void setIslock (java.lang.String islock) {
		this.islock = islock;
	}



	/**
	 * Return the value associated with the column: website
	 */
	public java.lang.String getWebsite () {
		return website;
	}

	/**
	 * Set the value related to the column: website
	 * @param website the website value
	 */
	public void setWebsite (java.lang.String website) {
		this.website = website;
	}



	/**
	 * Return the value associated with the column: stuffnum
	 */
	public java.lang.String getStuffnum () {
		return stuffnum;
	}

	/**
	 * Set the value related to the column: stuffnum
	 * @param stuffnum the stuffnum value
	 */
	public void setStuffnum (java.lang.String stuffnum) {
		this.stuffnum = stuffnum;
	}



	/**
	 * Return the value associated with the column: industry
	 */
	public java.lang.String getIndustry () {
		return industry;
	}

	/**
	 * Set the value related to the column: industry
	 * @param industry the industry value
	 */
	public void setIndustry (java.lang.String industry) {
		this.industry = industry;
	}



	/**
	 * Return the value associated with the column: nature
	 */
	public java.lang.String getNature () {
		return nature;
	}

	/**
	 * Set the value related to the column: nature
	 * @param nature the nature value
	 */
	public void setNature (java.lang.String nature) {
		this.nature = nature;
	}



	/**
	 * Return the value associated with the column: routeno
	 */
	public java.lang.Long getRouteno () {
		return routeno;
	}

	/**
	 * Set the value related to the column: routeno
	 * @param routeno the routeno value
	 */
	public void setRouteno (java.lang.Long routeno) {
		this.routeno = routeno;
	}



	/**
	 * Return the value associated with the column: routeorder
	 */
	public java.lang.Long getRouteorder () {
		return routeorder;
	}

	/**
	 * Set the value related to the column: routeorder
	 * @param routeorder the routeorder value
	 */
	public void setRouteorder (java.lang.Long routeorder) {
		this.routeorder = routeorder;
	}



	/**
	 * Return the value associated with the column: ADDRESSNO
	 */
	public com.eaoa.vo.pub.PubAddress getPubAddress () {
		return pubAddress;
	}

	/**
	 * Set the value related to the column: ADDRESSNO
	 * @param pubAddress the ADDRESSNO value
	 */
	public void setPubAddress (com.eaoa.vo.pub.PubAddress pubAddress) {
		this.pubAddress = pubAddress;
	}



	/**
	 * Return the value associated with the column: pubAccounts
	 */
	public java.util.Set<com.eaoa.vo.pub.PubAccount> getPubAccounts () {
		return pubAccounts;
	}

	/**
	 * Set the value related to the column: pubAccounts
	 * @param pubAccounts the pubAccounts value
	 */
	public void setPubAccounts (java.util.Set<com.eaoa.vo.pub.PubAccount> pubAccounts) {
		this.pubAccounts = pubAccounts;
	}

	public void addTopubAccounts (com.eaoa.vo.pub.PubAccount pubAccount) {
		if (null == getPubAccounts()) setPubAccounts(new java.util.TreeSet<com.eaoa.vo.pub.PubAccount>());
		getPubAccounts().add(pubAccount);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.eaoa.vo.pub.PubCustomer)) return false;
		else {
			com.eaoa.vo.pub.PubCustomer pubCustomer = (com.eaoa.vo.pub.PubCustomer) obj;
			if (null == this.getCustomerno() || null == pubCustomer.getCustomerno()) return false;
			else return (this.getCustomerno().equals(pubCustomer.getCustomerno()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getCustomerno()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getCustomerno().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}